package org.grayrabbit.cms.entity;

// Generated 2011-5-16 13:39:30 by Hibernate Tools 3.3.0.GA

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.OrderBy;

/**
 * CmsDictionary generated by hbm2java
 */
@Entity
@Table(name = "CMS_DICTIONARY")
public class Dictionary implements java.io.Serializable {

	private static final long serialVersionUID = 2863104882610333252L;
	private String dictionaryId;
	private DictionaryType dictionaryType;
	private String dictionaryKey;
	private String dictionaryValue;
	private String memo;
	private Integer ord;
	private String isLeaf;
	private Dictionary dictionary;
	private Set<Dictionary> dictionaries = new HashSet<Dictionary>(0);
	public Dictionary() {
	}

	public Dictionary(String dictionaryId) {
		this.dictionaryId = dictionaryId;
	}

	@Id
	@Column(name = "DICTIONARY_ID", unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid") 
	public String getDictionaryId() {
		return this.dictionaryId;
	}

	public void setDictionaryId(String dictionaryId) {
		this.dictionaryId = dictionaryId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DIC_TYPE_ID")
	public DictionaryType getDictionaryType() {
		return this.dictionaryType;
	}

	public void setDictionaryType(DictionaryType dictionaryType) {
		this.dictionaryType = dictionaryType;
	}

	@Column(name = "DICTIONARY_KEY", length = 32)
	public String getDictionaryKey() {
		return this.dictionaryKey;
	}

	public void setDictionaryKey(String dictionaryKey) {
		this.dictionaryKey = dictionaryKey;
	}

	@Column(name = "DICTIONARY_VALUE", length = 64)
	public String getDictionaryValue() {
		return this.dictionaryValue;
	}

	public void setDictionaryValue(String dictionaryValue) {
		this.dictionaryValue = dictionaryValue;
	}

	@Column(name = "MEMO", length = 256)
	public String getMemo() {
		return this.memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	@Column(name = "ORD", precision = 6, scale = 0)
	public Integer getOrd() {
		return this.ord;
	}

	public void setOrd(Integer ord) {
		this.ord = ord;
	}
	
	@Column(name = "IS_LEAF", precision = 6, scale = 0)
	public String getIsLeaf() {
		return isLeaf;
	}

	public void setIsLeaf(String isLeaf) {
		this.isLeaf = isLeaf;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARENT_ID")
	public Dictionary getDictionary() {
		return dictionary;
	}

	public void setDictionary(Dictionary dictionary) {
		this.dictionary = dictionary;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "dictionary")
	@OrderBy(clause="ord asc")
	public Set<Dictionary> getDictionaries() {
		return dictionaries;
	}

	public void setDictionaries(Set<Dictionary> dictionaries) {
		this.dictionaries = dictionaries;
	} 
}
